1. Technical Field
This invention generally relates to object oriented programming and more specifically relates to an apparatus and method that allows mechanisms at different levels in an object oriented framework to access common behavior in the framework.
2. Background Art
The development of the EDVAC computer system of 1948 is often cited as the beginning of the computer era. Since that time, computer systems have evolved into extremely sophisticated devices, and computer systems may be found in many different settings. Computer systems typically include a combination of hardware, such as semiconductors and circuit boards, and software, also known as computer programs. As advances in semiconductor processing and computer architecture push the performance of the computer hardware higher, more sophisticated computer software has evolved to take advantage of the higher performance of the hardware, resulting in computer systems today that are much more powerful than just a few years ago.
Computer systems typically include operating system software that controls the basic function of the computer, and one or more software application programs that run under the control of the operating system to perform desired tasks. For example, a typical IBM Personal Computer may run the OS/2 operating system, and under the control of the OS/2 operating system, a user may execute an application program, such as a word processor. As the capabilities of computer systems have increased, the application software programs designed for high performance computer systems have become extremely powerful. Additionally, software development costs have continued to rise because more powerfull and complex programs take more time, and hence more money, to produce.
One way in which the performance of application software programs has been improved while the associated development costs have been reduced is by using object oriented programming concepts. The goal of using object oriented programming is to create small, reusable sections of program code known as "objects" that can be quickly and easily combined and re-used to create new programs. This is similar to the idea of using the same set of building blocks again and again to create many different structures. The modular and re-usable aspects of objects will typically speed development of new programs, thereby reducing the costs associated with the development cycle. In addition, by creating and re-using a comprehensive set of well-tested objects, a more stable, uniform, and consistent approach to developing new computer programs can be achieved.
A central concept in object oriented programming is the "class." A class is a template that defines a type of object. A class outlines or describes the characteristics or makeup of objects that belong to that class. By defining a class, objects can be created that belong to the class without having to rewrite the entire definition for each new object. This feature of object oriented programming promotes the reusability of existing object definitions and promotes more efficient use of program code.
Frameworks are relatively recent developments in object oriented programming that provide a group of pre-packaged classes and class relationships that are designed to help a user easily extend the framework to write a particular software program, such as a software application. Some frameworks define various different levels of processing that must occur. An example of such a framework is an order processing framework that defines orders and order details. Assuming the framework allows for trasnsactions in different currencies, the framework will need to provide an exchange rate calculation at both the order level and at the order detail level. One solution is to provide different exchange rate calculations for each level. This solution is undesirable because it duplicates the code required to perform the exchange rate calculation, and it requires that the code be changed twice when the exchange rate calculation is updated. In addition, this could possibly lead to calculating the exchange rate one way at the Order level, and a different way at the Order Detail level. It would be preferable to have behavior, such as the exchange rate calculation, that could be used by different processing levels of the framework.
One way to allow common behavior at different processing levels in an object oriented framework is to provide a common base class for the different order levels. This solution is undesirable because it is not consistent with objective of defining levels in the framework according to the specific domain in which the framework is used. In addition, providing a common base class can lead to class definitions in the framework that are too restrictive and do not allow a user extending the framework the flexibility needed to program certain features in a software application. Extending the framework might then require changes to classes that the application does not own or have access to.
Without a way to provide support for common behavior on multiple levels in an object oriented framework without the drawbacks of known solutions, the power and flexibility of object oriented frameworks will be limited.